<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>radio</title>
</head>
<body>

<div id="app">
  <h2>radio只能选一个，需要唯一表示name，并且name的值不同，互斥</h2>

  <label for="male">
    <input type="radio" id="male" name="male" value="男" v-model="sex">男
  </label>
  <label for="female">
    <input type="radio" id="female" name="female" value="女" v-model="sex">女
  </label>
  <h2>你选择的性别是：{{sex}}</h2>

  <h2>但是有了v-model绑定同一个属性后，就可以不用name来区分了</h2>
  <label for="male">
    <input type="radio" id="male1" value="男1" v-model="sex1">男1
  </label>
  <label for="female">
    <input type="radio" id="female1" value="女1" v-model="sex1">女1
  </label>
  <h2>你选择的性别是：{{sex1}}</h2>
</div>
<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data: {
      message: '你好',
      sex: '男',
      sex1: '男1'
    }
  })
</script>
</body>
</html>
